
username =['aaa','bbb','ccc','ddd']
password =['a1111','b1111','c1111','d1111']


flag =True
count = 0

while flag:
    name = input("输入用户名：")
    pwd = input("输入密码：")

    if count <3:
        if  name in username and pwd == password[username.index(name)]:
            print("成功")
        else:
            print("错误")
        count += 1
    else:
        print("超过三次错误")
        flag = False











#
# flag = True
# count = 0
# while count<3:
#     name = input("请输入用户名：")
#     pwd = input("请输入密码：")
#     if name  in username and   pwd == password[username.index(name)]:
#         print(" 用户  %s 登录成功  "%name)
#         print(password[username.index(name)])
#     else:
#         print("用户名或者密码错误！")
#         count += 1
# else:
#         print("输入错误达到三次，自动退出！")
#
#
#
# # 使用for循环的效果
#
# while True:
#     name = input("输入用户名：")
#     pwd = input("输入密码：")
#     for i in username:
#         # print ("dadada",i)
#         if i == name :
#             # print( "%s" % name)
#             if password[username.index(i)] == pwd:
#                 print("用户 %s 登录成功" % i)
#                 break
#             else:
#                 print("用户或密码错误")
#                 break
#         else:
#             print("用户不存在")
#             continue